package com.maxh.service.impl;

import com.maxh.mapper.InformationMapper;
import com.maxh.pojo.Information;
import com.maxh.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("InformationService")
public class InformationServiceImpl implements InformationService {
    @Autowired(required =  false)
    InformationMapper informationMapper;

    //获取选课信息
    @Override
    public List<Map<String, Object>> getInformationList() {
        return informationMapper.informationList();
    }

    @Override
    public Object getInfoStudentList(Map<String, Object> map) {
        return informationMapper.findInformationById(map);
    }

    @Override
    public Boolean updateStatus(int id) {
        return informationMapper.updateInfoStatus(id);
    }

    @Override
    public Boolean updateRejectStatus(int id) {
        return informationMapper.updateReject(id);
    }

    @Override
    public Boolean addInformationList(Information information) {
        return informationMapper.saveInformation(information);
    }

    @Override
    public int searchInformationList(Information information) {
        return informationMapper.findInformationList(information);
    }

    @Override
    public List<Map<String, Object>> findStudentByCourseId(String teacherId, int courseId) {
        return informationMapper.findStudentInfo(teacherId,courseId);
    }

    @Override
    public Boolean updateMark(int id, String mark) {
        return informationMapper.saveMark(id,mark);
    }

    @Override
    public Object getStudentCourseList(Map<String, Object> map) {
        return informationMapper.findStudentCourse(map);
    }

    @Override
    public int searchStudentInformationList(Information information) {
        return informationMapper.findStudentInfoList(information);
    }

    @Override
    public Boolean cancelUpdateStatus(int id) {
        return informationMapper.cancelUpdateStatus(id);
    }

    @Override
    public Boolean updateStudentStatus(int id) {
        return informationMapper.updateStudentStatus(id);
    }

}
